import json


class UserInfo:
    def __init__(self, user_data):
        self.id = user_data.get('id')
        self.name = user_data.get('name')
        self.age = user_data.get('age')
        self.email = user_data.get('email')
        

    def __str__(self):
        return f"ID: {self.id}, 姓名: {self.name}, 年龄: {self.age}, 邮箱: {self.email}"


def read_json_file(filename):

    with open(filename, 'r', encoding='utf-8') as file:
        data = json.load(file)
    return data


def main():
    try:

        users_data = read_json_file('json.txt')


        users_list = [UserInfo(user) for user in users_data]


        for user in users_list:
            print(user)

    except FileNotFoundError:
        print("错误: 找不到json.txt文件")
    except json.JSONDecodeError:
        print("错误: json.txt文件格式不正确")


if __name__ == "__main__":
    main()